﻿<%@ page language="java" contentType="text/html;charset=UTF-8" %>
<%
//request.setCharacterEncoding("UTF-8");
//response.setCharacterEncoding("UTF-8");

%>
<HTML>
<HEAD>
<TITLE>▒▒ 게시판 ▒▒</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
<!--
  .table {font-size:9pt; font-family : 돋움 ;font-weight:bold;color:white;background:#6699CC; }
a {text-decoration: none; }
  td    { font-size : 10pt ; font-family : 돋움 ; font-decoration : none ;}
  font  { font-size : 10pt ; font-family : 돋움 ; font-decoration : none ; }
  #title{ font-size : 10pt ; font-family : 돋움 ; font-decoration : none ; font-weight : bold ; color : ffffff ;}
 .dform { font-family: 돋움 ; font-size:10pt;color:white;background:#6699CC;}
 .ldTable { border-bottom:#636363 solid 1px;border-color:white; padding-top:5px; padding-bottom:5px; padding-left:3px;
            padding-right:3px; font-size:9pt}
-->
</style>
<SCRIPT type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.js"></script>

<%
String id = (String)session.getAttribute("id");
String password = (String)session.getAttribute("password");

if(id==null || id==""){
out.println("아이디가 널값임");
}else{
%>
<script language="javascript">
$(document).ready(function() {

$("#name").attr("readonly","readonly");
$("#name").val("<%=id%>");
$("#pwd").attr("readonly","readonly");
$("#pwd").val("<%=password%>");
//$("#writetable tr:last-child").remove();

})
</script>
<%    
}
out.println(id);

%>
<script language="javascript">
    function saveit() {
        if(document.form.name.value.length==0){
            alert("이름을 써주세요..");
            form.name.focus();
            return;
        }
        if(document.form.title.value.length==0){
            alert("제목을 써주세요..");
            form.title.focus();
            return;
        }
        if(document.form.content.value.length==0){
            alert("내용을 써주세요..");
            form.content.focus();
            return;
        }
        if(document.form.pwd.value.length==0){
            alert("수정/삭제에 필요한 비밀번호을 써주세요..");
            form.pwd.focus();
            return;
        }
        document.charset='utf-8';
        document.form.submit();
    }
</script>

</HEAD>
<BODY bgcolor="#FFFFFF">

<CENTER>
<FONT size=2><B> 게시판 글쓰기 </B></FONT>
</CENTER>
<HR><P>

<!--<FORM name="form" method="post" action="<%//=response.encodeURL('writeproc.jsp')%>" accept-charset="UTF-8">-->
<FORM name="form" method="post" action="writeproc.jsp">
  <table width="500" border="0" cellspacing="0" cellpadding="1" align="center" bgcolor="#FFFFFF">
    <tr>
      <td colspan="3" height="290" ><table id="writetable" border="0" cellspacing="1" width="500" cellpadding="1" align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF">
          <tr>
            <td width="93" height="030" align="center" bgcolor="#8EA2FF"><font face="돋움" size="2" color="#FFFFFF"><strong>글쓴이</strong></font></td>
            <td width="400" height="030" align="left" style="padding-left: 20; padding-right: 30" bgcolor="#F6F6F6">
              <input type="text" name="name" size="20" id="name" style="border: 1 dashed">
            </td>
          </tr>
          <tr>
            <td width="93" height="030" align="center" bgcolor="#8EA2FF"><font face="돋움" size="2" color="#FFFFFF"><strong>E-mail</strong></font></td>
            <td width="400" height="030" align="left" style="padding-left: 20; padding-right: 30" bgcolor="#F6F6F6">
              <input type="text" name="email" size="30" style="border: 1 dashed">
            </td>
          </tr>
          <tr>
            <td width="93" height="030" align="center" bgcolor="#8EA2FF"><font face="돋움" size="2" color="#FFFFFF"><strong>제목</strong></font></td>
            <td width="400" height="030" align="left" style="padding-left: 20; padding-right: 30" bgcolor="#F6F6F6">
              <input type="text" name="title" size="30"  style="border-left: 1px dashed; border-right: 1 dashed; border-top: 1 dashed; border-bottom: 1 dashed">
            </td>
          </tr>          
          <tr>
            <td width="93" align="center" bgcolor="#8EA2FF"><font face="돋움" size="2" color="#FFFFFF"><strong>내용</strong></font></td>
            <td width="400" align="left" style="padding-left: 20;  padding-top: 5; padding-bottom: 5" bgcolor="#F6F6F6">
              <textarea name="content" cols='55' rows='10' wrap='physical' style="border: 1 dashed"></textarea>
            </td>
          </tr>
          <tr>
            <td width="93" height="030" align="center" bgcolor="#8EA2FF"><font face="돋움" size="2" color="#FFFFFF"><strong>비밀번호</strong></font></td>
            <td width="400" height="030" align="left" style="padding-left: 20; padding-right: 30" bgcolor="#F6F6F6">
              <input type="password" name="pwd" id="pwd" size="16" style="border: 1 dashed">
              &nbsp; <font face="돋움" size="2" color="#8EA2FF">[수정/삭제시 필요]</font></td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
  
  <p align="center">
  <table>
      <tr>
        <td>
            <a href="list.jsp"><img src="image/list.gif" border="0"></a><!-- 여기 -->         
        </td>
        <td>
        </td>
        <td>
            <a href="javascript:saveit()"><img src="image/export.gif" border="0"></a><!-- 여기 -->
        </td>
      </tr>
  </table>
  </p>

</FORM>

</BODY>
</HTML>